import { ResPage } from "@/api/interface/index";
import { ThirdParty } from "@/api/interface/thirdPartyManagement";
import { BASE } from "@/api/config/servicePort";
import http from "@/api";

/**
 * @name 第三方管理模块
 */
// 获取分组列表
export const getCardList = (params?: { no_pagination: 1 }) => {
  params ? (params.no_pagination = 1) : (params = { no_pagination: 1 });
  return http.get<ResPage<ThirdParty.ResThirdList>>(BASE + `/third_system/`, params);
};
// 删除三方系统
export const deleteThirdSystem = appId => {
  return http.delete<any>(BASE + `/third_system/${appId}/`);
};
// 校验密码
export const passwordVerify = params => {
  return http.post(BASE + `/auth/password_verify/`, params);
};

// 获取分组详情
export const getCardDetail = appId => {
  return http.get<ThirdParty.ResThirdList>(BASE + `/third_system/${appId}/`);
};

// 接入三方系统
export const addThirdSystem = params => {
  return http.post(BASE + `/third_system/`, params);
};

// 修改三方系统
export const modifyThirdSystem = (params, appId) => {
  return http.put(BASE + `/third_system/${appId}/`, params);
};

// 获取对接系统类型
export const getEnums = () => {
  return http.get<any>(BASE + `/third_system/enums/`);
};
